#ifndef A54D388D_B95A_4F0A_BFFB_DFAACD27FD82
#define A54D388D_B95A_4F0A_BFFB_DFAACD27FD82

    /*这个文件用来定义命名文件类*/

    #define FILE_PIPE "./_mfifo"
    #define MODE 0660

    enum
    {
        CREAT_ERR,
        FILE_DELE_ERR

    };

    #include <iostream>
    using namespace std;
    #include "unistd.h"
    #include <sys/types.h>
    #include <sys/stat.h>

    class mk_pipe
    {
    public:
        mk_pipe() /*初始化时直接创建一个命名管道*/
        {
            int n = mkfifo(FILE_PIPE, MODE);
            if (n == -1)
            {
                cout << "创建管道失败" << endl;
                exit(CREAT_ERR);
            }   
            // 创建管道成功
            cout << "信道创建成功" << endl;
        }

        ~mk_pipe()
        {
            int n = unlink(FILE_PIPE);
            if (n == -1)
            {
                cout << "删除管道失败" << endl;
                exit(FILE_DELE_ERR);
            }
            cout << "信道删除成功" << endl;

        }
    };

#endif /* A54D388D_B95A_4F0A_BFFB_DFAACD27FD82 */
